from multiprocessing import Queue
import time


if __name__ == '__main__':
    q = Queue(3)
    print(q.empty(), q.full())

    q.put('hello')
    q.put('world')
    q.put('python')
    time.sleep(1)

    print(q.empty(), q.full())

    # q.put('1') # 不报错，会一直等，等到有位置
    # q.put_nowait('2') # 报错

    if not q.empty():
        for i in range(3):
            print(q.get_nowait())


